<?php

use think\migration\Migrator;
use think\migration\db\Column;

class FlowScheme extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change()
    {
        $table = $this->table('flow_scheme', array('engine' => 'MyISAM', 'comment' => '分组管理'));
        $table->addColumn('flowcode', 'string', array('limit' => 255, 'null' => true, 'comment' => '流程代码'))
            ->addColumn('flowname', 'string', array('limit' => 255, 'null' => true, 'comment' => '流程名称'))
            ->addColumn('flowtype', 'string', array('limit' => 255, 'null' => true, 'comment' => '流程类型'))
            ->addColumn('flowcanuser', 'string', array('limit' => 255, 'null' => true, 'comment' => '流程管理员'))
            ->addColumn('flowcontent', 'text', array('null' => true, 'comment' => '流程json'))
            ->addColumn('createuser', 'string', array('limit' => 255,'null' => true, 'comment' => '流程json'))
            ->addColumn('updateuser', 'string', array('limit' => 255,'null' => true, 'comment' => '流程json'))
            ->addColumn('bizscheme', 'string', array('limit' => 255, 'null' => true, 'comment' => '对应业务表'))
            ->addColumn('isenable', 'integer', array('limit' => 11, 'null' => true, 'comment' => '字段标识'))
            ->addTimestamps()
            ->addSoftDelete()
            ->create();
    }
}
